using System;

namespace Log
{
    public abstract class Console
    {
        private static string CreateLogContent(string i_sMsg)
        {
            string sMsg = "[" + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString() + "]";
            sMsg += " ----- ";
            sMsg += i_sMsg;
            return sMsg;
        }

        public static void Write(string i_sMsg)
        {
            System.Console.WriteLine(CreateLogContent(i_sMsg));
        }

        public static void WriteLine(string i_sMsg)
        {
            System.Console.WriteLine(CreateLogContent(i_sMsg));
        }

        public static void SetReleaseOut()
        {
#if !DEBUG
			FileStream fs1 = new FileStream("Log.txt", FileMode.Append  );
			StreamWriter sw1 = new StreamWriter(fs1);
			sw1.AutoFlush = true;
			System.Console.SetOut(sw1);

#endif
        }
    }
}